}
>
> \let\stopMyCommand\relax
>
> \normalexpanded{\def\noexpand\dostartMyCommand[#1]#2\expandtoken\notcatcodes92
> stopMyCommand}%
> {\endgroup
> % whatever #1 does
> \setbuffer[foo]#2\endbuffer
> \typebuffer[foo]
> \getbuffer[foo]}
>
> or
>
[#1]%
{\begingroup
\setcatcodetable\notcatcodes
\dostartMyCommand[#1]}
\let\stopMyCommand\relax
\normalexpanded{\def\noexpand\dostartMyCommand[#1]#2\expandtoken\notcatcodes92
stopMyCommand}%
{\endgroup
% whatever #1 does
\setbuffer[foo]#2\endbuffer
\typebuffer[foo]
\getbuffer
; these useful features?
> buffers are stored as-is so no catcode magic stored, contrary to macros
>
> you can use \setbuffer but that doesn't solve the argument passing
>
> however, you can nest buffers so you can make other \start\stop commands
> buffers too and then do
was wondering how I
should define or expand #2 in the MWE below to make TeX happily accept these
useful features?
buffers are stored as-is so no catcode magic stored, contrary to macros
you can use \setbuffer but that doesn't solve the argument passing
however, you can nest buffers so you can make
\fi \else \let
\currentreg...
l.25 }
...l.11633 \stop
15
16 \registerctxluafile{page-run}{}
17
18 \unprotect
19
20 \unexpanded\gdef\showprint{\dotripleempty\page_layouts_show_print}
21
22 \gdef\page_layouts_show_print[#1][#2][#3]% only english
23
age-run}{}
17
18 \unprotect
19
20 \unexpanded\gdef\showprint{\dotripleempty\page_layouts_show_print}
21
22 \gdef\page_layouts_show_print[#1][#2][#3]% only english
23 {\setbuffer[crap]%
24 \unprotect
25 >> \definepapersize[X][\c!w
\getbuffer[Buf]
}
\def\T
{\setbuffer[Buf]a b ccc d e f\endbuffer
\getbuffer[Buf]}
Wolfgang
___
If your question is of interest to others as well, please add an entry to the
Wiki!
maillist : ntg-context@ntg.nl / http
On 1/10/2018 6:30 PM, Wolfgang Schuster wrote:
dr. Hans van der Meer <mailto:havdm...@ziggo.nl>
10. Januar 2018 um 13:45
With \setbuffer[ABUFFER] .. \endbuffer I can program a macro to put
something in this buffer.
But is it possible to add something at the end of this buffer at a
dr. Hans van der Meer <mailto:havdm...@ziggo.nl>
10. Januar 2018 um 13:45
With \setbuffer[ABUFFER] .. \endbuffer I can program a macro to put
something in this buffer.
But is it possible to add something at the end of this buffer at a
later moment?
You can use the “buffers.
With \setbuffer[ABUFFER] .. \endbuffer I can program a macro to put something
in this buffer.
But is it possible to add something at the end of this buffer at a later moment?
Hans van der Meer
___
If your question
with alternatives like \startbuffer[lettercontent] … endbuffer. The \input problem remains: it appears that the buffer takes any command (\foo) as literal text.I tried moving the setbuffer … endbuffer part to elswhere in the document. I also experimented with \input a sample text of my own on my
rnalfilter@set_filenames
\setbuffer[\externalfilter@buffer_name]#3\endbuffer
\externalfilter@process_filter
\stoptexdefinition
\protect
\defineexternalfilter
[ASY]
[
filtercommand={asy -tex context \externalfilterinputfile\space -o
\externalfilteroutputfil
\externalfiter@set_indeed}
\starttexdefinition externalfiter@set_indeed [#1][#2]#3
% #1 = filter
% #2 = options
\begingroup
\edef\currentexternalfilter{#1}
\setupexternalfilter[#1][\c!name=,#2]
\externalfilter@set_filenames
\setbuffer[\externalfilter@buffer_name]#3\endbuffer
]
[
filtercommand={asy -tex context \externalfilterinputfile\space -o
\externalfilteroutputfile}, output=\externalfilterbasefile.pdf,
purge=no,
cache=yes,
readcommand=\ReadImage,
]
\define[1]\ReadImage{\externalfigure[#1]}
\define[1]\mycircle{
#1 - XXX
\setbuffer[ASY]
import
[MARKDOWN]
[
filtercommand={pandoc -f markdown -t context
\externalfilterinputfile\space -o \externalfilteroutputfile},
cache=yes,
purge=no, % Just for testing. May be removed.
]
\define[1]\TEST
{\setbuffer[MARKDOWN]This is #1\endbuffer
\processMARKDOWNbuffer
llowed by .
The getbuffer setup is not even reached, as is obvious.
I tried \xmltofile to put the data into an intermediate file, but to
no avail because it produces the following, leading at best to
recursion when processed by \xmlprocessfile.
bufferdata
Is there a solution to this?
\set
März 2016 um 10:11
>
>
> \startbuffer .. \stopbuffer is parsed special
>
> so use:
>
> \def\Buffer#1#2
> {\setbuffer[#1]{\input #2\relax}}
>
> \def\Buffer#1#2%
> {\setbuffer[#1]\input{#2}\endbuffer}
>
> Wolfgang
>
>
> ___
Hans Hagen <mailto:pra...@wxs.nl>
30. März 2016 um 10:11
\startbuffer .. \stopbuffer is parsed special
so use:
\def\Buffer#1#2
{\setbuffer[#1]{\input #2\relax}}
\def\Buffer#1#2%
{\setbuffer[#1]\input{#2}\endbuffer}
Wo
nuth}
>>
>>
>> \stoptext
>>
>> -
>>
>>
>> Context gives me the following error on this:
>>
>>
>> tex error > tex error on line 9 in file
>> C:/Users/emargraf/Documents/buffer.tex: ! Undefined cont
use:
\def\Buffer#1#2
{\setbuffer[#1]{\input #2\relax}}
\Buffer{bla}{knuth}
but i'm not sure what you gain here as it will still input tufte each time
Hans
-
Hans Hagen | PRAGMA
...
\stopmyinput
\stopbuffer
but now not executed at once, but stored in and executable from a buffer with
\getbuffer[mystoragebuffer].
\setbuffer[foo]bar\endbuffer
But of course there might be a better way to execute the same code more than
once within one run of TeX.
for that to answer
Hi,
as far as I have understood MathML, elements tagged with mathvariant=bold
should be set upright bold, not bold-italic.
Could this be corrected, please?
Thank you very much!
Steffen
---
\usemodule[mathml] \starttext
\placeformula\startformula[9pt]
\setbuffer mml:math xmlns:mml=http
Hi,
usually it is possible to break long formulas.
But is there a way to do so, when formula is coded in mathml (see example
below)?
Thanks, Steffen
---
\placeformula\startformula[9pt]
\setbuffer mml:math xmlns:mml=http://www.w3.org/1998/Math/MathML;
msub xmlns=http://www.w3.org/1998
6 \usemodule[mathml] \starttext
7
8
9 \setbuffer mml:math xmlns:mml=http://www.w3.org/1998/Math/MathML;
10 mi xmlns=http://www.w3.org/1998/Math/MathML; mathvariant=bolda/mi
11 mo xmlns=http://www.w3.org/1998/Math/MathML;∈/mo
12 mi xmlns=http://www.w3.org/1998/Math
Am 08.06.2013 um 12:53 schrieb Steffen Wolfrum cont...@st.estfiles.de:
Hi friends,
we need to run MathML inside \sym (see below).
Is there a way to solve the error ! Argument of \buff_gobble has an extra }.
You can’t use \startbuffer … \stopbuffer in other commands but with \setbuffer
\startbuffer … \stopbuffer in other commands but with \setbuffer
there is a command which can be used here.
\sym{\setbuffer … \endbuffer\processxmlbuffer}
great, thanks. but this immediately gives the next error: invalid xml file -
parsed text
what's wrong with the code below?
Steffen
the error ! Argument of \buff_gobble has an extra
}.
You can’t use \startbuffer … \stopbuffer in other commands but with
\setbuffer
there is a command which can be used here.
\sym{\setbuffer … \endbuffer\processxmlbuffer}
great, thanks. but this immediately gives the next error: invalid
Hi,
any idea, how to get it
mi mathvariant=boldp/mi
typeset in bold??
Steffen
---
\usemodule[mathml] \starttext
\placeformula\startformula[9pt]
\setbuffer mml:math xmlns:mml=http://www.w3.org/1998/Math/MathML;
mi xmlns=http://www.w3.org/1998/Math/MathML;π/mi
mo xmlns=http://www.w3
[abc]
whatever
\stopbuffer
Now I get: ! Missing } inserted.
Because running this in isolation goes without a problem, I suspect the
change has to do with the project structure in which I use the buffer. But
again, it worked in the past.
Does it works with
\setbuffer[abc]
whatever
\endbuffer
. But again, it
worked in the past.
Does it works with
\setbuffer[abc]
whatever
\endbuffer
?
It works with these macros, yes. Thanks.
But is \setbuffer..\endbuffer something new? I do not see it on the Reference
page of the wiki. Also it doesn't seem in line with ConTeXt's regular naming
scheme
with the project structure in which I use the buffer. But
again, it worked in the past.
Does it works with
\setbuffer[abc]
whatever
\endbuffer
?
It works with these macros, yes. Thanks.
But is \setbuffer..\endbuffer something new? I do not see it on the
Reference page of the wiki
in which I use the buffer. But
again, it worked in the past.
Does it works with
\setbuffer[abc]
whatever
\endbuffer
?
It works with these macros, yes. Thanks.
But is \setbuffer..\endbuffer something new?
No, it’s a old command but not very useful for a user.
I do not see
On 3-11-2011 23:01, Stefan Müller wrote:
\define\Doesnt{\startxtable \startxrow \startxcell does not work
\stopxcell \stopxrow \stopxtable}
\starttext
\Works \stopxtable
%\Doesnt
\stoptext
\def\test
{\setbuffer[demo]
\startxtable
\startxrow
\startxcell
On 11/4/11 10:38 AM, Hans Hagen wrote:
\def\test
{\setbuffer[demo]
\startxtable
\startxrow
\startxcell does not work \stopxcell
\stopxrow
\stopxtable
\endbuffer
\processxtablebuffer[demo]}
Hans,
is the solution to my xml problem along
On 4-11-2011 11:11, Thomas A. Schmitz wrote:
On 11/4/11 10:38 AM, Hans Hagen wrote:
\def\test
{\setbuffer[demo]
\startxtable
\startxrow
\startxcell does not work \stopxcell
\stopxrow
\stopxtable
\endbuffer
\processxtablebuffer[demo]}
Hans,
is the solution to my xml problem along these lines
On 3-11-2011 23:01, Stefan Müller wrote:
\define\Doesnt{\startxtable \startxrow \startxcell does not work
\stopxcell \stopxrow \stopxtable}
\starttext
\Works \stopxtable
%\Doesnt
\stoptext
\def\test
{\setbuffer[demo]
\startxtable
\startxrow
On 4-11-2011 18:18, Stefan Müller wrote:
On 3-11-2011 23:01, Stefan Müller wrote:
\define\Doesnt{\startxtable \startxrow \startxcell does not work
\stopxcell \stopxrow \stopxtable}
\starttext
\Works \stopxtable
%\Doesnt
\stoptext
\def\test
{\setbuffer[demo
([[0,0],[1,4],[4,4],[3,0],[0,0]]);text([2.5,4],44,above);text([3.5,2],44,right);stroke=red;fontfill=red;line([1,0],[1,4]);text([1,2],?,right);'
/
Write the whole block to a external file and read import it them with
\externalfigure.
\startxmlsetups xml:embed
\setbuffer[embed]\xmlflush{#1
\setbuffer[embed]\xmlflush{#1}\endbuffer
\savebuffer[embed][embed.svg]
\externalfigure[embed.svg]
\stopxmlsetups
remind me to make a \xmltofile some time
-
Hans Hagen | PRAGMA ADE
],[1,4]);text([1,2],?,right);'
/
Write the whole block to a external file and read import it them with
\externalfigure.
\startxmlsetups xml:embed
\setbuffer[embed]\xmlflush{#1}\endbuffer
\savebuffer[embed][embed.svg]
\externalfigure[embed.svg]
\stopxmlsetups
remind me to make
Am 13.12.2010 um 12:04 schrieb Yury G. Kudryashov:
Hi!
Why the following doesn't work?
\def\mybuf{\startbuffer[a]b\stopbuffer}
\def\mybuf{\setbuffer[a]b\endbuffer}
Wolfgang
___
If your question
is already there. \type parses the contents correctly,
and
\startbuffer writes it to an external file. Something that combines the
two will
be great.
Such a feature will be handy for inline syntax highlighting with the t-vim
module.
\setbuffer[bla]more bla\endbuffer
highlighting with the t-vim
module.
\setbuffer[bla]more bla\endbuffer
That does not work in mkii and does not look right for the user interface.
For pretty printing using the inbuilt macros, one can use
\startTEX
\stopTEX
and \typeTEX{...}
Normally, I want the display version to insert blank
}}
{\startTEXapplication[#1]{\usemodule[pstric]}#2\stopTEXapplication}}
for \startTEXapplication see
page-app.tex
\long\def\dostartTEXapplication[#1]#2#3\stopTEXapplication
{\bgroup
\bgroup
\let\f!temporaryextension\c!tex
\setbuffer[\@@texapp]%
\starttext
#2% preamble
Am 14.02.2009 um 10:09 schrieb Wolfgang Schuster:
Hi Hans,
why is \setbuffer not defined as \long, I want to use it as part
of a macro and need it to allow paragraphs as content.
Can you change this?
TIA,
Wolfgang
Wolfgang Schuster wrote:
Am 14.02.2009 um 10:09 schrieb Wolfgang Schuster:
Hi Hans,
why is \setbuffer not defined as \long, I want to use it as part
of a macro and need it to allow paragraphs as content.
Can you change this?
no need as \dosetbuffer is defined as \long and \setbuffer
On Sat, Feb 14, 2009 at 10:09 AM, Wolfgang Schuster
schuster.wolfg...@googlemail.com wrote:
Hi Hans,
why is \setbuffer not defined with \long, I want to use it as part
of a macro and need it to allow paragraphs as content.
Can you change this?
TIA,
Wolfgang
Am 14.02.2009 um 10:09 schrieb Wolfgang Schuster:
Hi Hans,
why is \setbuffer not defined with \long, I want to use it as part
of a macro and need it to allow paragraphs as content.
Can you change this?
TIA,
Wolfgang
Hi Hans,
why is \setbuffer not defined with \long, I want to use it as part
of a macro and need it to allow paragraphs as content.
Can you change this?
TIA,
Wolfgang
___
If your question is of interest to others
this:
\starttext
\placefigure
{}
{\startbuffer{mybuffer}
Floating text from a buffer
\stopbuffer
\getbuffer{mybuffer}}
\stoptext
with content saved in a buffer.
no, there is \setbuffer but in general (at least not in context mkii)
buffers are to be defined at the outer level
\getbuffer{mybuffer}}
\stoptext
with content saved in a buffer.
no, there is \setbuffer but in general (at least not in context mkii)
buffers are to be defined at the outer level
It's not a real problem but I wanted to know if it is possible to
define a environment in the way I wanted
with content saved in a buffer.
no, there is \setbuffer but in general (at least not in context mkii)
buffers are to be defined at the outer level
It's not a real problem but I wanted to know if it is possible to
define a environment in the way I wanted.
Hi Hans,
I looked into core-buf
{%
\egroup% from \dostartlilypond
\bgroup%
%...
\global\advance\lily!figures\plusone
\startmode[*\v!first]%
\def\obeyedlines{\string^^J}%
\convertargument#2\to\ascii
\expanded{%
\setbuffer[lilypond-\the\lily!figures]%
% here it works, all buffers are numbered
% ...
\ascii
\dodostartlilypond[#1]#2\stoplilypond{%
\egroup% from \dostartlilypond
\bgroup%
%...
\global\advance\lily!figures\plusone
\startmode[*\v!first]%
\def\obeyedlines{\string^^J}%
\convertargument#2\to\ascii
\expanded{%
\setbuffer[lilypond-\the\lily!figures
\startstatistics
{\dodoubleempty\dostartstatistics}
\def\dostartstatistics[#1][#2]#3\stopstatistics
{\setbuffer[#1]#3\endbuffer
\executesystemcommand{ruby wordcount.rb \jobname-#1.tmp}%
\getbuffer[#1]}
\protect \doifnotmode{demo}{\endinput}
... but a friend who asked me for a favour actually
\doStartLong}
\egroup
\def\doStartLong#1\StopLong{%
\setbuffer[x]#1\endbuffer
\endgroup
\getbuffer[x]
}
\starttext
\StartLong
\starttyping
abcde
\stoptyping
and now
for something
completely different
\StopLong
\stoptext
Christopher
___
ntg-context
this:
\bgroup
\catcode`\^^M=\active
\gdef\StartLong{\begingroup\obeylines\let^^M^^J\doStartLong}
\egroup
\def\doStartLong#1\StopLong{%
\setbuffer[x]#1\endbuffer
\endgroup
\getbuffer[x]
}
\starttext
\StartLong
\starttyping
abcde
\stoptyping
and now
for something
completely
57 matches
Mail list logo